﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Menu.Master" AutoEventWireup="true" CodeBehind="frmItinerario.aspx.cs" Inherits="GestionCurriculosGlobal.frmItinerario" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
 <script>
     function ConfirmDelete(codPlan, codCurso) {
         if (codPlan == 0 || codCurso == 0 ) {
             alert('No existen itinerarios a eliminar.');
         } else {
             if (confirm("Esta seguro de eliminar el itinerario seleccionado")) {
                 document.getElementById("ContentPlaceHolder1_hidCodPlan").value = codPlan;
                 document.getElementById("ContentPlaceHolder1_hidCodCurso").value = codCurso;
                 document.getElementById("ContentPlaceHolder1_btnEliminarTrue").click();
             } else {
                 document.getElementById("ContentPlaceHolder1_hidCodPlan").value = 0;
                 document.getElementById("ContentPlaceHolder1_hidCodCurso").value = 0;
             }
         }
     }
     function CheckOne(obj) {
         var grid = obj.parentNode.parentNode.parentNode;
         var inputs = grid.getElementsByTagName("input");
         var row = obj.parentNode.parentNode;

         for (var i = 0; i < inputs.length; i++) {
             if (inputs[i].type == "checkbox") {
                 if (obj.checked && inputs[i] != obj && inputs[i].checked) {
                     inputs[i].checked = false;

                     var gvDrv = document.getElementById("<%=gvItinerarios.ClientID %>");
                     for (i = 1; i < gvDrv.rows.length; i++) {
                         gvDrv.rows[i].style.border = "initial";
                     }
                 }
             }
         }

         if (obj.checked) {
             row.style.border = "solid";
         }
         else {
             row.style.border = "initial";
         }
     }
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
<div style="margin:5px; font-family:Rambla">
    <asp:HiddenField runat="server" ID="hidCodCurso"/>
    <asp:HiddenField runat="server" ID="hidCodPlan"/>
    <div style="text-align:center">
        <h1> Lista de Itinerarios Formativos </h1>
    </div>

    <!-- BOTONERA -->
    <div style="width:90%; height:25px; background-color:#064066;">
        &nbsp;&nbsp;
        <asp:Button runat="server" ID="btnCrear" Text="Crear" onclick="btnCrear_Click"/>
        <asp:Button runat="server" ID="btnModificar" Text="Modificar" 
            onclick="btnModificar_Click"/>
        <asp:Button runat="server" ID="btnEliminar" Text="Eliminar" style="display:none"
            onclick="btnEliminar_Click"/>
        <asp:Button runat="server" ID="btnEliminarTrue" Text="Eliminar" style="display:none"
            onclick="btnEliminarTrue_Click"/>
    </div>
    <!-- GRILLA --> 
    <asp:UpdatePanel runat="server" ID="up1">
            <ContentTemplate>
    <div>
        <div>
       
            <table>
                <tr>
                    <td>Plan Curricular</td>
                    <td>:</td>
                    <td><asp:DropDownList runat="server" ID="cboPlan" Width="180" 
                            onselectedindexchanged="cboPlan_SelectedIndexChanged" AutoPostBack="true"></asp:DropDownList></td>
                    <td>&nbsp;&nbsp;</td>
                    <td style="display:none">Ciclo</td>
                    <td style="display:none">:</td>
                    <td style="display:none"><asp:DropDownList runat="server" ID="cboCiclo" Width="180" ></asp:DropDownList></td>
                    <td style="display:none">&nbsp;&nbsp;</td>
                    <td><asp:Button runat="server" ID="btnConsultar" Text="Consultar" 
                            onclick="btnConsultar_Click"/></td>
                </tr>
            </table>
            
        </div>
        <div style="margin-top:5px">
            <asp:GridView runat="server" style="text-align:left" ID="gvItinerarios" AutoGenerateColumns="False" 
                CellPadding="4" ForeColor="#333333" GridLines="Vertical" Width="80%" 
               ><%-- OnRowDataBound="gvCursos_RowDataBound" --%>
                <AlternatingRowStyle BackColor="White" />
                <Columns>
                    <asp:TemplateField>
                        <ItemTemplate>
                            <asp:CheckBox runat="server" id="chkItinerario" onclick ="CheckOne(this)"/>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:BoundField DataField="codPlanCurricular" HeaderText="Código de Plan" />
                    <asp:BoundField DataField="nombrePlan" HeaderText="Plan Curricular" />
                    <asp:BoundField DataField="nroVersion" HeaderText="Versión" />
                    <asp:BoundField DataField="nombre" HeaderText="Carrera" />
                </Columns>
                <EditRowStyle BackColor="#2461BF" />
                <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                <HeaderStyle BackColor="#064066" Font-Bold="True" ForeColor="White" BorderColor="Black" BorderStyle="solid" BorderWidth="1px" />
                <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
                <RowStyle BackColor="#EFF3FB" />
                <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
                <SortedAscendingCellStyle BackColor="#F5F7FB" />
                <SortedAscendingHeaderStyle BackColor="#6D95E1" />
                <SortedDescendingCellStyle BackColor="#E9EBEF" />
                <SortedDescendingHeaderStyle BackColor="#4870BE" />
            </asp:GridView>
        </div>
    </div>
            </ContentTemplate>
    </asp:UpdatePanel>
</div>
<!-- <RowStyle BackColor="#EFF3FB"  BorderColor="Black" BorderStyle="solid" BorderWidth="1px"  /> -->
</asp:Content>
